Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASM][ATO] Collect session id at all times #6623

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Feb 3, 2025

Summary of changes

Collects session id in any case:

  • .net core: on endpoint matched
  • net framework: try access it through httpcontext
    User doesn't need to be authenticated anymore for it to collect the session id.

Reason for change

Session id should always be collected, not only when user is authenticated.

Implementation details

there are guards for netcore as accessing Session when it's not been setup just throws. So this way we make sure it's setup for the webapp.

Test coverage

Change all snapshots.
Scrubbing pitfalls:

  • scrub cookies and session id for aspnet mvc because if there's a session id it will always change the cookies
  • scrub cookies and session id for aspnet core when user is authenticated / logged in (as it will keep changing)
  • other cases in aspnet core: just scrub session fingerprint

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Feb 3, 2025

Datadog Report

Branch report: anna/asm/add-sessionid-beginning-request
Commit report: b9e859b
Test service: dd-trace-dotnet

❌ 121 Failed (0 Known Flaky), 244485 Passed, 2226 Skipped, 18h 48m 39.81s Total Time

❌ Failed Tests (121)

This report shows up to 5 failed tests.

  • TestAuthenticatedRequest - Datadog.Trace.Security.IntegrationTests.AspNetCore5AutoUserEventsDefaultModeSecurityEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.received.txt
     Verified: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestAuthenticatedRequest - Datadog.Trace.Security.IntegrationTests.AspNetCore5AutoUserEventsDefaultModeSecurityEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.received.txt
     Verified: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestAuthenticatedRequest - Datadog.Trace.Security.IntegrationTests.AspNetCore5AutoUserEventsDefaultModeSecurityEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.received.txt
     Verified: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestAuthenticatedRequest - Datadog.Trace.Security.IntegrationTests.AspNetCore5AutoUserEventsDefaultModeSecurityEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.received.txt
     Verified: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestAuthenticatedRequest - Datadog.Trace.Security.IntegrationTests.AspNetCore5AutoUserEventsDefaultModeSecurityEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.received.txt
     Verified: Security.AspNetCore5AutoUserEvents.SecurityOn.defaultmode-TestAuthenticatedRequest.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    

@andrewlock
Copy link
Member

andrewlock commented Feb 3, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (69ms)  : 66, 71
     .   : milestone, 69,
    master - mean (69ms)  : 66, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (991ms)  : 968, 1014
     .   : milestone, 991,
    master - mean (992ms)  : 960, 1024
     .   : milestone, 992,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (102ms)  : 100, 104
     .   : milestone, 102,
    master - mean (102ms)  : 100, 104
     .   : milestone, 102,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (670ms)  : 650, 691
     .   : milestone, 670,
    master - mean (674ms)  : 659, 690
     .   : milestone, 674,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (89ms)  : 87, 91
     .   : milestone, 89,
    master - mean (89ms)  : 87, 91
     .   : milestone, 89,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (625ms)  : 606, 645
     .   : milestone, 625,
    master - mean (630ms)  : 615, 645
     .   : milestone, 630,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (191ms)  : 186, 196
     .   : milestone, 191,
    master - mean (191ms)  : 188, 195
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (1,102ms)  : 1072, 1132
     .   : milestone, 1102,
    master - mean (1,105ms)  : 1077, 1133
     .   : milestone, 1105,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (271ms)  : 266, 275
     .   : milestone, 271,
    master - mean (272ms)  : 266, 278
     .   : milestone, 272,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (863ms)  : 820, 905
     .   : milestone, 863,
    master - mean (868ms)  : 834, 903
     .   : milestone, 868,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6623) - mean (265ms)  : 259, 271
     .   : milestone, 265,
    master - mean (262ms)  : 258, 266
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (6623) - mean (850ms)  : 819, 881
     .   : milestone, 850,
    master - mean (849ms)  : 811, 886
     .   : milestone, 849,

Loading

@andrewlock
Copy link
Member

andrewlock commented Feb 3, 2025

Benchmarks Report for appsec 🐌

Benchmarks for #6623 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.123
  • 2 benchmarks have fewer allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6623

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 1.130 191,118.65 215,897.85
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 1.116 187,764.85 209,544.79

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 188μs 180ns 674ns 2.74 0 0 193.47 KB
master AllCycleSimpleBody netcoreapp3.1 281μs 486ns 1.88μs 2.72 0 0 200.94 KB
master AllCycleSimpleBody net472 257μs 198ns 766ns 36.8 2.04 0 231.51 KB
master AllCycleMoreComplexBody net6.0 191μs 111ns 416ns 2.77 0 0 196.98 KB
master AllCycleMoreComplexBody netcoreapp3.1 298μs 229ns 887ns 2.68 0 0 204.36 KB
master AllCycleMoreComplexBody net472 262μs 396ns 1.54μs 37.3 2.09 0 235.03 KB
master ObjectExtractorSimpleBody net6.0 141ns 0.426ns 1.86ns 0.00391 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 201ns 0.161ns 0.602ns 0.00374 0 0 272 B
master ObjectExtractorSimpleBody net472 209ns 0.117ns 0.437ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.05μs 11.7ns 45.3ns 0.0529 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.85μs 2.37ns 8.54ns 0.0503 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.42μs 2.95ns 11.4ns 0.601 0.00663 0 3.8 KB
#6623 AllCycleSimpleBody net6.0 210μs 65.2ns 235ns 2.71 0 0 193.33 KB
#6623 AllCycleSimpleBody netcoreapp3.1 310μs 142ns 532ns 2.78 0 0 200.8 KB
#6623 AllCycleSimpleBody net472 274μs 189ns 733ns 36.7 2.05 0 231.35 KB
#6623 AllCycleMoreComplexBody net6.0 216μs 86.7ns 324ns 2.81 0 0 196.83 KB
#6623 AllCycleMoreComplexBody netcoreapp3.1 324μs 215ns 803ns 2.73 0 0 204.22 KB
#6623 AllCycleMoreComplexBody net472 281μs 129ns 482ns 37.3 2.1 0 234.87 KB
#6623 ObjectExtractorSimpleBody net6.0 139ns 0.0903ns 0.338ns 0.00394 0 0 280 B
#6623 ObjectExtractorSimpleBody netcoreapp3.1 221ns 0.552ns 2.14ns 0.00364 0 0 272 B
#6623 ObjectExtractorSimpleBody net472 208ns 0.259ns 1ns 0.0445 0 0 281 B
#6623 ObjectExtractorMoreComplexBody net6.0 2.92μs 1.21ns 4.51ns 0.0541 0 0 3.78 KB
#6623 ObjectExtractorMoreComplexBody netcoreapp3.1 3.92μs 1.32ns 4.93ns 0.0511 0 0 3.69 KB
#6623 ObjectExtractorMoreComplexBody net472 4.22μs 2.37ns 8.53ns 0.603 0.0063 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 37μs 29.2ns 113ns 0.462 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.7μs 22.7ns 87.8ns 0.436 0 0 32.4 KB
master EncodeArgs net472 66.8μs 45.1ns 175ns 5.16 0.0787 0 32.5 KB
master EncodeLegacyArgs net6.0 77.2μs 17.5ns 65.4ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 107μs 68.5ns 256ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 152μs 93.6ns 363ns 0.305 0 0 2.15 KB
#6623 EncodeArgs net6.0 37.6μs 17.8ns 68.7ns 0.453 0 0 32.4 KB
#6623 EncodeArgs netcoreapp3.1 54.6μs 19.8ns 76.6ns 0.434 0 0 32.4 KB
#6623 EncodeArgs net472 66.3μs 81.5ns 315ns 5.16 0.0661 0 32.5 KB
#6623 EncodeLegacyArgs net6.0 79.3μs 70.2ns 272ns 0 0 0 2.14 KB
#6623 EncodeLegacyArgs netcoreapp3.1 106μs 147ns 531ns 0 0 0 2.15 KB
#6623 EncodeLegacyArgs net472 153μs 104ns 388ns 0.307 0 0 2.15 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 175μs 82.2ns 307ns 0 0 0 2.54 KB
master RunWafRealisticBenchmark netcoreapp3.1 189μs 233ns 901ns 0 0 0 2.49 KB
master RunWafRealisticBenchmark net472 201μs 90.1ns 349ns 0.398 0 0 2.55 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 69ns 249ns 0 0 0 1.57 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 213ns 824ns 0 0 0 1.55 KB
master RunWafRealisticBenchmarkWithAttack net472 134μs 60.8ns 235ns 0.199 0 0 1.58 KB
#6623 RunWafRealisticBenchmark net6.0 175μs 88.3ns 330ns 0 0 0 2.54 KB
#6623 RunWafRealisticBenchmark netcoreapp3.1 188μs 139ns 500ns 0 0 0 2.49 KB
#6623 RunWafRealisticBenchmark net472 200μs 50ns 194ns 0.399 0 0 2.55 KB
#6623 RunWafRealisticBenchmarkWithAttack net6.0 117μs 79.1ns 306ns 0 0 0 1.57 KB
#6623 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 64ns 222ns 0 0 0 1.55 KB
#6623 RunWafRealisticBenchmarkWithAttack net472 134μs 49.5ns 192ns 0.2 0 0 1.58 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6623

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 263.86 KB 254.22 KB -9.63 KB -3.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.76 KB 54.56 KB -5.2 KB -8.70%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 55.1μs 301ns 1.67μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 58.5μs 690ns 6.69μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37μs 103ns 387ns 0 0 0 59.76 KB
master StringConcatAspectBenchmark net6.0 311μs 3.45μs 32.3μs 0 0 0 252.85 KB
master StringConcatAspectBenchmark netcoreapp3.1 337μs 1.8μs 11.1μs 0 0 0 263.86 KB
master StringConcatAspectBenchmark net472 239μs 1.08μs 3.91μs 0 0 0 278.53 KB
#6623 StringConcatBenchmark net6.0 58.2μs 613ns 6.1μs 0 0 0 43.44 KB
#6623 StringConcatBenchmark netcoreapp3.1 53.8μs 242ns 906ns 0 0 0 42.64 KB
#6623 StringConcatBenchmark net472 37.7μs 101ns 379ns 0 0 0 54.56 KB
#6623 StringConcatAspectBenchmark net6.0 293μs 5.67μs 56.4μs 0 0 0 254.07 KB
#6623 StringConcatAspectBenchmark netcoreapp3.1 351μs 1.75μs 7.63μs 0 0 0 254.22 KB
#6623 StringConcatAspectBenchmark net472 269μs 4.42μs 41.7μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

andrewlock commented Feb 3, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6623 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.149
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.86μs 43.2ns 256ns 0.0155 0.00777 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 52.9ns 339ns 0.0256 0.0102 0 5.8 KB
master StartStopWithChild net472 16.3μs 51ns 197ns 1.03 0.295 0.0878 6.21 KB
#6623 StartStopWithChild net6.0 7.85μs 44.9ns 330ns 0.0231 0.0116 0 5.61 KB
#6623 StartStopWithChild netcoreapp3.1 9.99μs 42.2ns 163ns 0.0191 0.00954 0 5.8 KB
#6623 StartStopWithChild net472 16μs 45ns 174ns 1.04 0.299 0.0971 6.2 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 466μs 340ns 1.32μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 666μs 666ns 2.58μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 851μs 504ns 1.95μs 0.428 0 0 3.3 KB
#6623 WriteAndFlushEnrichedTraces net6.0 492μs 449ns 1.68μs 0 0 0 2.7 KB
#6623 WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 686ns 2.66μs 0 0 0 2.7 KB
#6623 WriteAndFlushEnrichedTraces net472 844μs 425ns 1.65μs 0.419 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 135μs 198ns 766ns 0.172 0 0 14.47 KB
master SendRequest netcoreapp3.1 151μs 169ns 655ns 0.226 0 0 17.27 KB
master SendRequest net472 2.88E‑05ns 2.88E‑05ns 0.000108ns 0 0 0 0 b
#6623 SendRequest net6.0 132μs 284ns 1.1μs 0.137 0 0 14.47 KB
#6623 SendRequest netcoreapp3.1 148μs 474ns 1.84μs 0.223 0 0 17.28 KB
#6623 SendRequest net472 0.000404ns 0.000196ns 0.000734ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 581μs 3.37μs 27.6μs 0.556 0 0 41.55 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 679μs 3.72μs 21μs 0.317 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 845μs 2.21μs 7.97μs 8.3 2.62 0.437 53.3 KB
#6623 WriteAndFlushEnrichedTraces net6.0 556μs 2.84μs 13.9μs 0.551 0 0 41.59 KB
#6623 WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.8μs 24.1μs 0.332 0 0 41.75 KB
#6623 WriteAndFlushEnrichedTraces net472 853μs 4.36μs 20.9μs 8.87 2.53 0.422 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.29μs 1.77ns 6.86ns 0.0146 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.84μs 1.16ns 4.48ns 0.0137 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 2.37ns 8.86ns 0.156 0.00105 0 987 B
#6623 ExecuteNonQuery net6.0 1.31μs 1.24ns 4.8ns 0.0144 0 0 1.02 KB
#6623 ExecuteNonQuery netcoreapp3.1 1.78μs 1.82ns 7.04ns 0.0136 0 0 1.02 KB
#6623 ExecuteNonQuery net472 2.02μs 1.32ns 4.78ns 0.156 0.00101 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.23μs 0.53ns 1.98ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.59μs 0.624ns 2.33ns 0.0134 0 0 976 B
master CallElasticsearch net472 2.4μs 1.69ns 6.53ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.35μs 1.61ns 6.25ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.65μs 0.9ns 3.49ns 0.0133 0 0 1.02 KB
master CallElasticsearchAsync net472 2.55μs 1.78ns 6.41ns 0.167 0 0 1.05 KB
#6623 CallElasticsearch net6.0 1.24μs 0.623ns 2.41ns 0.0137 0 0 976 B
#6623 CallElasticsearch netcoreapp3.1 1.51μs 1.31ns 4.9ns 0.0131 0 0 976 B
#6623 CallElasticsearch net472 2.55μs 1.65ns 6.19ns 0.158 0 0 995 B
#6623 CallElasticsearchAsync net6.0 1.39μs 1.23ns 4.77ns 0.0132 0 0 952 B
#6623 CallElasticsearchAsync netcoreapp3.1 1.74μs 0.906ns 3.39ns 0.014 0 0 1.02 KB
#6623 CallElasticsearchAsync net472 2.5μs 1.67ns 6.47ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.28μs 0.417ns 1.62ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.58μs 1.1ns 4.1ns 0.0126 0 0 952 B
master ExecuteAsync net472 1.88μs 0.381ns 1.48ns 0.145 0 0 915 B
#6623 ExecuteAsync net6.0 1.34μs 0.583ns 2.18ns 0.0133 0 0 952 B
#6623 ExecuteAsync netcoreapp3.1 1.64μs 1.08ns 4.19ns 0.0131 0 0 952 B
#6623 ExecuteAsync net472 1.87μs 1.01ns 3.9ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.43μs 1.71ns 6.64ns 0.0332 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.22μs 2.51ns 9.4ns 0.0367 0 0 2.85 KB
master SendAsync net472 7.53μs 3ns 11.6ns 0.494 0 0 3.12 KB
#6623 SendAsync net6.0 4.39μs 2.09ns 8.08ns 0.0329 0 0 2.31 KB
#6623 SendAsync netcoreapp3.1 5.42μs 1.3ns 4.68ns 0.0377 0 0 2.85 KB
#6623 SendAsync net472 7.41μs 0.986ns 3.82ns 0.496 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.51μs 1.83ns 7.09ns 0.0233 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.34μs 9.08ns 35.2ns 0.0219 0 0 1.64 KB
master EnrichedLog net472 2.54μs 1.91ns 7.39ns 0.249 0 0 1.57 KB
#6623 EnrichedLog net6.0 1.5μs 1.77ns 6.6ns 0.023 0 0 1.64 KB
#6623 EnrichedLog netcoreapp3.1 2.31μs 1.44ns 5.39ns 0.0216 0 0 1.64 KB
#6623 EnrichedLog net472 2.67μs 1.59ns 6.15ns 0.25 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 115μs 581ns 2.53μs 0.0567 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 116μs 109ns 408ns 0.0574 0 0 4.28 KB
master EnrichedLog net472 149μs 134ns 519ns 0.67 0.223 0 4.46 KB
#6623 EnrichedLog net6.0 113μs 105ns 406ns 0.0567 0 0 4.28 KB
#6623 EnrichedLog netcoreapp3.1 117μs 158ns 614ns 0.0581 0 0 4.28 KB
#6623 EnrichedLog net472 149μs 65.6ns 245ns 0.672 0.224 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.15μs 0.59ns 2.21ns 0.0313 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.04μs 1.27ns 4.9ns 0.0282 0 0 2.2 KB
master EnrichedLog net472 4.79μs 1.59ns 6.16ns 0.319 0 0 2.02 KB
#6623 EnrichedLog net6.0 3μs 0.9ns 3.49ns 0.0299 0 0 2.2 KB
#6623 EnrichedLog netcoreapp3.1 4.27μs 1.68ns 6.27ns 0.0299 0 0 2.2 KB
#6623 EnrichedLog net472 4.86μs 1.58ns 6.12ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.35μs 0.549ns 2.13ns 0.0161 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.79μs 1.78ns 6.65ns 0.015 0 0 1.14 KB
master SendReceive net472 2.05μs 0.928ns 3.47ns 0.183 0 0 1.16 KB
#6623 SendReceive net6.0 1.31μs 0.629ns 2.44ns 0.0164 0 0 1.14 KB
#6623 SendReceive netcoreapp3.1 1.74μs 1.71ns 6.64ns 0.0156 0 0 1.14 KB
#6623 SendReceive net472 2.08μs 0.965ns 3.74ns 0.183 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.85μs 1.02ns 3.83ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.95μs 6.95ns 26.9ns 0.0215 0 0 1.65 KB
master EnrichedLog net472 4.26μs 3.29ns 12.7ns 0.324 0 0 2.04 KB
#6623 EnrichedLog net6.0 2.82μs 1.96ns 7.35ns 0.0224 0 0 1.6 KB
#6623 EnrichedLog netcoreapp3.1 4.02μs 1.17ns 4.37ns 0.0221 0 0 1.65 KB
#6623 EnrichedLog net472 4.11μs 2.13ns 8.26ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6623

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.162 665.48 572.85

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 403ns 0.44ns 1.71ns 0.00802 0 0 576 B
master StartFinishSpan netcoreapp3.1 600ns 0.81ns 3.14ns 0.00776 0 0 576 B
master StartFinishSpan net472 665ns 1.36ns 5.26ns 0.0917 0 0 578 B
master StartFinishScope net6.0 531ns 0.752ns 2.91ns 0.0098 0 0 696 B
master StartFinishScope netcoreapp3.1 771ns 1.3ns 5.05ns 0.00955 0 0 696 B
master StartFinishScope net472 857ns 2.43ns 9.41ns 0.104 0 0 658 B
#6623 StartFinishSpan net6.0 398ns 0.401ns 1.5ns 0.00819 0 0 576 B
#6623 StartFinishSpan netcoreapp3.1 578ns 0.54ns 2.09ns 0.00768 0 0 576 B
#6623 StartFinishSpan net472 572ns 0.995ns 3.85ns 0.0915 0 0 578 B
#6623 StartFinishScope net6.0 480ns 0.686ns 2.66ns 0.00983 0 0 696 B
#6623 StartFinishScope netcoreapp3.1 707ns 2.37ns 9.17ns 0.00928 0 0 696 B
#6623 StartFinishScope net472 850ns 1.59ns 6.15ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6623

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.136 1,063.17 935.64

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 686ns 0.566ns 2.19ns 0.00983 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.06μs 1.21ns 4.67ns 0.00952 0 0 696 B
master RunOnMethodBegin net472 1.15μs 0.573ns 2.14ns 0.104 0 0 658 B
#6623 RunOnMethodBegin net6.0 644ns 1.33ns 5.15ns 0.00968 0 0 696 B
#6623 RunOnMethodBegin netcoreapp3.1 935ns 1.08ns 4.18ns 0.00935 0 0 696 B
#6623 RunOnMethodBegin net472 1.09μs 2.61ns 10.1ns 0.104 0 0 658 B

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

36 occurrences of :

-      _dd.appsec.fp.session: ssn--bd9bce81-d0fff5a7-,
+      _dd.appsec.fp.session: ssn--bd9bce81-d0fff5a7-<SessionFp>,

82 occurrences of :

+      _dd.appsec.fp.session: ssn----<SessionFp>,

1 occurrences of :

-      _dd.appsec.fp.session: ssn-5860faf0---,
+      _dd.appsec.fp.session: ssn-5860faf0---<SessionFp>,

11 occurrences of :

-      _dd.appsec.fp.session: ssn-<fingerprint>,
+      _dd.appsec.fp.session: ssn-7bcd1c9f---<SessionFp>,

3 occurrences of :

-      _dd.appsec.fp.session: ssn-<fingerprint>,
+      _dd.appsec.fp.session: ssn-ef8eb89f---<SessionFp>,

50 occurrences of :

+      _dd.appsec.fp.session: ssn--<CookieFields>-<CookieValues>-<SessionFp>,

3 occurrences of :

-      _dd.appsec.s.req.cookies: [{"cookie-key":[8]}],
+      _dd.appsec.s.req.cookies: [{"ASP.NET_SessionId":[8],"cookie-key":[8]}],

@anna-git anna-git force-pushed the anna/asm/add-sessionid-beginning-request branch 13 times, most recently from bc3fe93 to 6ff252f Compare February 13, 2025 10:56
@anna-git anna-git force-pushed the anna/asm/add-sessionid-beginning-request branch 2 times, most recently from a5b6a37 to 1727f6b Compare February 13, 2025 15:17
@anna-git anna-git changed the title Anna/asm/add sessionid beginning request [ASM][ATO] Collect session id at all times Feb 13, 2025
@anna-git anna-git force-pushed the anna/asm/add-sessionid-beginning-request branch from 1727f6b to 4ff5982 Compare February 13, 2025 17:09
@anna-git anna-git marked this pull request as ready for review February 13, 2025 19:13
@anna-git anna-git requested review from a team as code owners February 13, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants